﻿<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<link rel="stylesheet" href="CSS/index-common.css">
		<link rel="stylesheet" href="CSS/index-global.css">
		<script type="text/javascript" src="JS/common.js"></script>
		<script type="text/javascript" src="JS/Index/base-all.js"></script>
		<script type="text/javascript" src="JS/Index/common-header.js"></script>
	</head>

	<body onresize="resizeHeight()">
		<div data-spm="2">
			<div class="ali-common-header">
				<div class="ali-common-header-inner common-header-clearfix">
					<div class="activity item pull-left">
						<div id="J-ali-activity-img">
							<div style="margin-top: 6px;"><span style="color:#A1D499;font-size: 18px;"><img src="images/login/login_logo.png" width="240px" height="55px"/></span></div>
						</div>

					</div>
					<!-- 导航菜单 -->
					<div id="accord"></div>
					<div style="float:right;margin-top: 20px;color:white;font-size: 13px;">
						<span><a href="#" id="username" style="color:#4BAE34"></a></span>
						<span><a href="#" id="logout" style="color:#4BAE34">注销</a></span>
						<span><a href="#" style="margin-left: 10px;color:#4BAE34" onclick="modiPassword()">修改密码</a></span>
					</div>
				</div>
			</div>
		</div>
		<iframe id="ifrmList" src="content.html" frameborder="0" width="100%"></iframe>
		<!--<div id="gsFooter">
			<div class="footer" style="letter-spacing: 3px;">版权所有:绵阳北电世纪科技有限公司</div>
		</div>-->
	</body>
	<script type="text/javascript">
		////测试可删除信息
		$(document).ready(function() {
			var height = document.documentElement.clientHeight - 60;
			console.log(height);
			document.getElementById("ifrmList").height = height + "px";
		});
		localStorage['loginUser'] = "admin";
		var _menus = {
			basic: [{
				"menuid": "01",
				"menuname": "物流管理",
				"menus": [{
					"menuid": "011",
					"menuname": "采购流程",
					"submenus": [{
						"menuid": "0133",
						"menuname": "网络订单",
						"url": "UI/LOGISTICS/WebOrder/WebOrderAdd.html"
					}, {
						"menuid": "0111",
						"menuname": "原始订单",
						"url": "UI/LOGISTICS/OriginalOrder/OriginalOrderAdd.html"
					}, {
						"menuid": "0114",
						"menuname": "销售订单",
						"url": "UI/LOGISTICS/SellOrder/SellOrderAdd.html"
					}, {
						"menuid": "0114",
						"menuname": "采购单",
						"url": "UI/LOGISTICS/PurchaseOrder/PurchaseOrderSearch.html"
					}, {
						"menuid": "0115",
						"menuname": "入库单",
						"url": "UI/LOGISTICS/WarehouseScheduleCreate/WarehouseScheduleSearch.html"
					}, ]
				}, {
					"menuid": "012",
					"menuname": "销售流程",
					"submenus": [{
						"menuid": "0121",
						"menuname": "销售单",
						"url": "UI/LOGISTICS/SalesOrder/SalesOrderSearch.html"
					}, {
						'menuid': "0122",
						"menuname": "出库单",
						"icon": "icon-nav",
						"url": "UI/LOGISTICS/WareHouseOutOrder/WareHouseOutOrderSearch.html"
					}, {
						'menuid': "0122",
						"menuname": "配送管理",
						"icon": "icon-nav",
						"url": "UI/LOGISTICS/DeliverManagementOrder/DeliverManagementOrderSearch.html"
					}, {
						'menuid': "0123",
						"menuname": "销售结算",
						"icon": "icon-nav",
						"url": "UI/LOGISTICS/SalesSettlementOrder/SalesSettlementSearch.html"
					}, ]
				}, {
					"menuid": "013",
					"menuname": "库房管理",
					"submenus": [{
						'menuid': "0134",
						"menuname": "库存盘点",
						"icon": "icon-nav",
						"url": "UI/LOGISTICS/InventoryOrder/InventoryOrderAdd.html"
					}, {
						'menuid': "0135",
						"menuname": "冲销帐",
						"icon": "icon-nav",
						"url": "UI/LOGISTICS/WriteOff/WriteOffAdd.html"
					}, {
						"menuid": "0132",
						"menuname": "价格维护表",
						"url": "UI/LOGISTICS/BasicInformation/BasicInformationPriceAdd.html"
					}, {
						"menuid": "0132",
						"menuname": "移库单",
						"url": "UI/LOGISTICS/StockTransferOrder/StockTransferOrderAdd.html"
					}, ]
				}, {
					"menuid": "013",
					"menuname": "基础信息",
					"submenus": [{
						'menuid': "0131",
						"menuname": "订单日志",
						"icon": "icon-nav",
						"url": "UI/LOGISTICS/ExecuteOrder/ExecuteOrderList.html"
					}, {
						"menuid": "0132",
						"menuname": "物流基础信息",
						"url": "UI/LOGISTICS/BasicInformation/BasicInformation.html"
					}, {
						'menuid': "0133",
						"menuname": "修改记录",
						"icon": "icon-nav",
						"url": "UI/LOGISTICS/Log/LogSearch.html"
					}, ]
				}, ]
			}]
		};
		CreateAccordion();

		function CreateAccordion() {
			var content = "";
			content = "<ul class='menu item pull-left' id='J_common_header_menu' data-spm='201'>";
			for(var i = 0; i < _menus.basic.length; i++) {
				var _menuData = _menus.basic[i];

				// 第一级菜单
				content = content + "<li class='top-menu-item' has-dropdown='true' menu-type='training' data-spm-click=''><a class='menu-hd'>" + _menuData.menuname + "</a><div class='menu-dropdown solutions training-bg'><div class='menu-dropdown-inner module-padding training-inner common-header-clearfix'>";
				for(var j = 0; j < _menuData.menus.length; j++) {
					content = content + "<div class='module-wrap' style='width:200px'><div class='module-hd'>" + _menuData.menus[j].menuname + "</div><div class='module-bd'>";
					var _submenuData = _menuData.menus[j];
					for(var m = 0; m < _submenuData.submenus.length; m++) {
						content = content + "<a name='" + _submenuData.submenus[m].menuname + "'rel='" + _submenuData.submenus[m].url + "' onclick='addnav(this.rel,this.name)'> " + _submenuData.submenus[m].menuname + " </a>";
					}
					content = content + "</div></div>";
				}
				content = content + "</li>";
			}
			content = content + "</ul>";
			$("#accord").append(content);
		}

		function addnav(_url, _name) {
			AddTabIn(_name, $("#ifrmList")[0].contentWindow.$('#tabs'), _url);
			//			$("#ifrmList")[0].contentWindow.$('#dg')

		}

		$(function() {
			$("#logout").click(function() {
				localStorage['loginUser'] = "";
				window.location = "UI/Common/Login/login.html";
			});

			$("#username").html("当前用户:" + localStorage['loginUser']);

		});

		function resizeHeight() {
			var height = document.documentElement.clientHeight - 60;
			document.getElementById("ifrmList").height = height + "px";
		}

		function modiPassword() {
			puser = localStorage['loginUser'];
			var pLocation = "UI/Common/Login/modiPassword.html?id=" + puser;
			$("#ifrmEdit").attr("src", pLocation);
			addnav(pLocation, "修改密码");
		}
	</script>

</html>